<?php

/**
* @author trungdt
* @since Feb 2011
* 
*/
/**
* Change logs
* Feb 11, 2011 - trungdt - Add views FeatureTab, so, we must add configure that LinkList module will automatic remove html of body field
* Sep 22, 2011 - trungdt - Add No_search support
* 
*                ALTER TABLE `ag_linklistmodule_config` ADD `remove_body_html` INT( 1 ) NOT NULL DEFAULT '0' COMMENT '=0: No remove, =1: remove'
* 
* Sep 6, 2011 - trungdt - Add config: show Default view when in Administrator mode or not
* 
*    
*/

class profilemodule_config {
	function form($object) {
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();
        //default scr='config'
		$form = new form();
		$object->id=1;
        $object->last_time=time();
        $form->register('url','URL',new textcontrol($object->url));
        $form->register('baseurl','Server base url',new textcontrol($object->baseurl));
        $form->register('username','Username',new textcontrol($object->username));
        $form->register('password','Password',new passwordcontrol(''));
        $form->register('max_item_page','Max item per page',new textcontrol($object->max_item_page));
		$html='<script type="text/javascript" src="'.THEME_RELATIVE.'modules/profilemodule/js/check.js"></script>
        <input type="button" value="Check user" onclick="__check()"/>
        <div id="resultcheck"></div>';
        $form->register('check','Check',new htmlcontrol($html));
        
        
		$form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
		return $form;
	}

	function update($values,$object) {
		
        $object->username = trim($values['username']);
		$object->password = md5($values['password']);
        $object->baseurl = trim($values['baseurl']);
        $object->url = trim($values['url']);
        $object->max_item_page = trim($values['max_item_page']);
        
		return $object;
	}
}

?>